let mysql=require('mysql2');
const { resolve } = require('path');
let connevion=mysql.createConnection({
    host:'127.0.0.1',
    user:"root",
    password:"root",
    database:"mydb"
})
connevion.connect();
function query(sql) {
    return new Promise((resolve,reject)=>{
        connevion.query(sql,(err,data)=>{
            if(err!=null){
                reject(err)
            }else{
                resolve(data)
            }
        })
    })
}
async function useA(sql){
    let rev=await query(sql);
    console.log(rev);
    connevion.end();
}
useA("SELECT * FROM `mydb`.`use`");